#ifndef CCMAINWINDOW_H
#define CCMAINWINDOW_H

#include <QMainWindow>
#include <QPushButton>
#include <QTableView>
#include <QSettings>
#include <QHash>
#include "creditcardprofile.h"
#include "creditcarddelegate.h"
#include "creditcardtablemodel.h"

namespace Ui {
class CCMainWindow;
}

class CCMainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit CCMainWindow(QPushButton *button, QWidget *parent = 0);
    ~CCMainWindow();
    void closeEvent(QCloseEvent *event);
    CreditCardDelegate      *profile_delegate;
    QTableView              *table_view;
    CreditCardTableModel    *profile_model;

public slots:
    void    SaveAsDefaultProfileList();
    void    SaveProfileList();
    void    LoadProfileList(QString file_name="", bool selectFileFromDialogue=true);
    void    updateTableView(int row);
    void    selectionChanged(QItemSelection selected, QItemSelection deselected);
private:
    Ui::CCMainWindow *ui;
    QPushButton *m_button;
    QString     *profileListFile;
};

#endif // CCMAINWINDOW_H
